//
//  BBPack.h
//  BBGameLib
//
//  Created by Eric on 12/23/11.
//  Copyright 2011 __MyCompanyName__. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "cocos2d.h"


@interface BBPackAction : NSObject{
    CCNode* _node;
    CCFiniteTimeAction* _action;
    id _delegate;
    SEL _callback;
    id _data;
}
@property(nonatomic,retain)CCNode* node;
@property(nonatomic,retain)CCFiniteTimeAction* action;
@property(nonatomic,retain)id delegate;
@property(nonatomic)SEL callback;
@property(nonatomic,retain)id data;

+(id)action:(CCNode*)node ccaction:(CCFiniteTimeAction*)action;
-(void)initPack:(CCNode*)node ccaction:(CCFiniteTimeAction*)action;
-(void)doAction;
@end

@interface BBPackActionAsyn : BBPackAction
@end



@interface BBPackSequence : BBPackAction{
    NSMutableArray* _packs;
}
+(id) actions;
+(id) actions:(BBPackAction*)pack1,...NS_REQUIRES_NIL_TERMINATION;
+(id) actionsWithArray: (NSArray*) actions;
-(void)addPack:(BBPackAction*)pack;
-(void)addPacks:(NSArray*)packs;
@end

@interface BBPackSequenceAsyn : BBPackSequence{
    BOOL callbackDone;
}
@end


@interface BBPackSpawn : BBPackSequence
@end

@interface BBPackSpawnAsyn : BBPackSpawn{
    BOOL callbackDone;
}
@end

@interface BBPackFunc : BBPackAction {
    id tgt;
    SEL func;
}
@property(nonatomic,retain)id tgt;
@property(nonatomic)SEL func;
+(id)action:(id)tgt func:(SEL)funcs;
@end


@interface BBPackFuncD : BBPackFunc {
    id param;
}
@property(nonatomic,retain)id param;
+(id)action:(id)tgt func:(SEL)func param:(id)param;
@end

@interface BBPackFuncDD : BBPackFuncD {
    id param2;
}
@property(nonatomic,retain)id param2;
+(id)action:(id)tgt func:(SEL)func param:(id)param param2:(id)param2;
@end

@interface BBPackFuncDL : BBPackFunc
-(void)doActionWithData:(id)data;
@end


